package com.syedu.day04;

import com.syedu.util.DateUtil;

import java.util.Date;

/**
 * description：测试老版日期工具类
 * @author Administrator
 * @date 2022/3/9 15:38
 */
public class TestDateUtil {
    public static void main(String[] args) {
        //得到当前日期
        Date date = new Date();

        //调用工具类来格式化日期
        //String formatDate = DateUtil.formatDate(date);//默认模板格式化
        String formatDate = DateUtil.formatDate(date,"yyyy-MM-dd");
        System.out.println(formatDate);

        System.out.println("-----------------------------------");

        //调用工具类创建指定年月日的日期
        Date createDate = DateUtil.createDate(2012, 12, 12);
        System.out.println(createDate);
    }
}